Did anybody figure out how to suppress #Include statement errors in Attr-DXL? I know the -logfile switch can suppress interpret and run-time errors, but it doesn't suppress no-such-file #include errors. |
Re: Suppress #Include errors
Well, I create a new formal module 'm'. Put a DXL attribute with the dxl: #include <lkjlkj> in there. (temporarily create the file), save, close. Delete the file. Opening the module from the database explorer I get an error. Now I open it by DXL:
noError(); Module m = read ("m", false); lastError();
print (null m); close m
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Suppress #Include errors Mathias Mamsch - Thu Aug 23 03:52:54 EDT 2012
Well, I create a new formal module 'm'. Put a DXL attribute with the dxl: #include <lkjlkj> in there. (temporarily create the file), save, close. Delete the file. Opening the module from the database explorer I get an error. Now I open it by DXL:
noError(); Module m = read ("m", false); lastError();
print (null m); close m
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
My objective was to suppress the errors when the user double clicks to open. I came up with this:
string PreOpen =
" bool preOpen(Trigger trg)
{ ModuleVersion mv = version(trg) // Module we intend to open
if (null mv) infoBox(\"preOpen, null mv\")
else
{ infoBox(\"preOpen '\" name(mv) \"'\")
noError()
share(fullName(mv), true, false, false) // this does NOT re-trigger the trigger
lastError()
}
return(false) // module opens above, this prevents the originalo "open" from firing.
}
Trigger t = current
if (preOpen(t)) //
then set(trigPreConPass)
else set(trigPreConFail)
" // end 'string PreOpen'
if (confirm("Delete??")) then {delete ("PreOpen", project->module->all, pre, open, 10)}
elseif(confirm("Deploy??")) then {trigger("PreOpen", project->module->all, pre, open, 10, PreOpen)}
|
Re: Suppress #Include errors llandale - Thu Aug 23 10:17:33 EDT 2012 My objective was to suppress the errors when the user double clicks to open. I came up with this:
string PreOpen =
" bool preOpen(Trigger trg)
{ ModuleVersion mv = version(trg) // Module we intend to open
if (null mv) infoBox(\"preOpen, null mv\")
else
{ infoBox(\"preOpen '\" name(mv) \"'\")
noError()
share(fullName(mv), true, false, false) // this does NOT re-trigger the trigger
lastError()
}
return(false) // module opens above, this prevents the originalo "open" from firing.
}
Trigger t = current
if (preOpen(t)) //
then set(trigPreConPass)
else set(trigPreConFail)
" // end 'string PreOpen'
if (confirm("Delete??")) then {delete ("PreOpen", project->module->all, pre, open, 10)}
elseif(confirm("Deploy??")) then {trigger("PreOpen", project->module->all, pre, open, 10, PreOpen)}
I remember that I experimented with a similar thing. A Pre-Open trigger that will 'noError' and a post-open trigger that will do lastError, but that had some strange effects, since some stuff goes on between pre-open and post open where one wanted errors to occur (but I do not remember what exactly). Another bad thing was, that the trigger would apply also to all DXL scripts, getting in their way of opening the module exactly how they wanted it.
evalTop_ "void dummy(DBE x,int y) { noError(); doubleClickCB(x,y); lastError(); }; set (dbExpList , selectCB, selectCB, dummy)"
...
void openReadOnlyNoError() {
noError();
openReadOnly()
lastError();
}
void openShareNoError() {
noError();
openShare()
lastError();
}
void openEditNoError () {
noError();
openEdit()
lastError();
}
void addOpenMenuItems() {
createItem(canOpenFolder, openFolder ,LS_("String_Open",NLSTEMP_("Open")), 'O', 'O',modKeyCtrl, null, null, LS_("String_Open_the_selected_folder",
NLSTEMP_("Open the selected folder.")), LS_("String_You_must_select_a_folder_to_open",NLSTEMP_("You must select a folder to open.")))
createMenu(canOpenModuleAny, LS_("String_Open",NLSTEMP_("Open")), 'O', null);
createItem(canOpenModuleReadOnly ,openReadOnlyNoError ,LS_("String_Read_only",NLSTEMP_("Read-only")),'R', 'R', modKeyCtrl, null, null,
LS_("String_Open_the_selected_module_read_only",NLSTEMP_("Open the selected module read-only.")),
LS_("String_You_have_no_access_to_open_the_selected_module_read_only",NLSTEMP_("You have no access to open the selected module read-only.")))
createItem(canOpenModuleShare, openShareNoError, LS_("String_Shareable_Edit",NLSTEMP_("Shareable Edit")),'S', 'S', modKeyCtrl, null, null,
LS_("String_Open_the_selected_module_for_shareable_edit",NLSTEMP_("Open the selected module for shareable edit.")),
LS_("String_You_have_no_access_to_open_the_selected_module_for_shareable_edit",
NLSTEMP_("You have no access to open the selected module for shareable edit.")));
createItem(canOpenModuleFull, openEditNoError, LS_("String_Exclusive_Edit",NLSTEMP_("Exclusive Edit")),'E', 'E', modKeyCtrl, null, null,
LS_("String_Open_the_selected_module_for_exclusive_edit",NLSTEMP_("Open the selected module for exclusive edit.")),
LS_("String_You_have_no_access_to_open_the_selected_module_for_exclusive_edit",
NLSTEMP_("You have no access to open the selected module for exclusive edit.")));
end menu // Open
}
#include <config/baseWindowShow4_.inc>
// lets introduce the new hook for db explorer list
void doubleClickCBNoError (DBE x,int y) { noError(); doubleClickCB(x,y); lastError(); }
set (dbExpList , selectCB, selectCB, doubleClickCBNoError )
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Suppress #Include errors Mathias Mamsch - Thu Aug 23 16:54:40 EDT 2012
I remember that I experimented with a similar thing. A Pre-Open trigger that will 'noError' and a post-open trigger that will do lastError, but that had some strange effects, since some stuff goes on between pre-open and post open where one wanted errors to occur (but I do not remember what exactly). Another bad thing was, that the trigger would apply also to all DXL scripts, getting in their way of opening the module exactly how they wanted it.
evalTop_ "void dummy(DBE x,int y) { noError(); doubleClickCB(x,y); lastError(); }; set (dbExpList , selectCB, selectCB, dummy)"
...
void openReadOnlyNoError() {
noError();
openReadOnly()
lastError();
}
void openShareNoError() {
noError();
openShare()
lastError();
}
void openEditNoError () {
noError();
openEdit()
lastError();
}
void addOpenMenuItems() {
createItem(canOpenFolder, openFolder ,LS_("String_Open",NLSTEMP_("Open")), 'O', 'O',modKeyCtrl, null, null, LS_("String_Open_the_selected_folder",
NLSTEMP_("Open the selected folder.")), LS_("String_You_must_select_a_folder_to_open",NLSTEMP_("You must select a folder to open.")))
createMenu(canOpenModuleAny, LS_("String_Open",NLSTEMP_("Open")), 'O', null);
createItem(canOpenModuleReadOnly ,openReadOnlyNoError ,LS_("String_Read_only",NLSTEMP_("Read-only")),'R', 'R', modKeyCtrl, null, null,
LS_("String_Open_the_selected_module_read_only",NLSTEMP_("Open the selected module read-only.")),
LS_("String_You_have_no_access_to_open_the_selected_module_read_only",NLSTEMP_("You have no access to open the selected module read-only.")))
createItem(canOpenModuleShare, openShareNoError, LS_("String_Shareable_Edit",NLSTEMP_("Shareable Edit")),'S', 'S', modKeyCtrl, null, null,
LS_("String_Open_the_selected_module_for_shareable_edit",NLSTEMP_("Open the selected module for shareable edit.")),
LS_("String_You_have_no_access_to_open_the_selected_module_for_shareable_edit",
NLSTEMP_("You have no access to open the selected module for shareable edit.")));
createItem(canOpenModuleFull, openEditNoError, LS_("String_Exclusive_Edit",NLSTEMP_("Exclusive Edit")),'E', 'E', modKeyCtrl, null, null,
LS_("String_Open_the_selected_module_for_exclusive_edit",NLSTEMP_("Open the selected module for exclusive edit.")),
LS_("String_You_have_no_access_to_open_the_selected_module_for_exclusive_edit",
NLSTEMP_("You have no access to open the selected module for exclusive edit.")));
end menu // Open
}
#include <config/baseWindowShow4_.inc>
// lets introduce the new hook for db explorer list
void doubleClickCBNoError (DBE x,int y) { noError(); doubleClickCB(x,y); lastError(); }
set (dbExpList , selectCB, selectCB, doubleClickCBNoError )
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
I don't approve of modifying the install; seems like a CM nightmare to me.
string Override =
" Module readNoErrors(string NameMod, bools whatevers)
{ noErrors()
Module mod = read(NameMod, whatevers)
lastError()
return(mod)
}
Module read(string NameMod, bools whatevers)
{ readNoErrors(NameMod, whatevers)
}
" // end 'string Override'
evalTop_(Override)
|
Re: Suppress #Include errors llandale - Fri Aug 24 09:14:30 EDT 2012
I don't approve of modifying the install; seems like a CM nightmare to me.
string Override =
" Module readNoErrors(string NameMod, bools whatevers)
{ noErrors()
Module mod = read(NameMod, whatevers)
lastError()
return(mod)
}
Module read(string NameMod, bools whatevers)
{ readNoErrors(NameMod, whatevers)
}
" // end 'string Override'
evalTop_(Override)
Hmm ... I think the problem is the same complexity as updating a DOORS client in a company, which also cannot be a CM nightmare. But nevertheless a solution that does not modify the install will modify DXL behaviour. Yes we could hook the perms at startup:
// Yes the DOORS client uses read/share/edit(string) to open a module
doors.exe -cli "evalTop_(\"Module read(string s) { print 123 }; Module share(string s) { print 456 }; Module edit(string s) { print 234;}\")"
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Suppress #Include errors llandale - Fri Aug 24 09:14:30 EDT 2012
I don't approve of modifying the install; seems like a CM nightmare to me.
string Override =
" Module readNoErrors(string NameMod, bools whatevers)
{ noErrors()
Module mod = read(NameMod, whatevers)
lastError()
return(mod)
}
Module read(string NameMod, bools whatevers)
{ readNoErrors(NameMod, whatevers)
}
" // end 'string Override'
evalTop_(Override)
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Suppress #Include errors Mathias Mamsch - Fri Aug 24 16:02:14 EDT 2012
Hmm ... I think the problem is the same complexity as updating a DOORS client in a company, which also cannot be a CM nightmare. But nevertheless a solution that does not modify the install will modify DXL behaviour. Yes we could hook the perms at startup:
// Yes the DOORS client uses read/share/edit(string) to open a module
doors.exe -cli "evalTop_(\"Module read(string s) { print 123 }; Module share(string s) { print 456 }; Module edit(string s) { print 234;}\")"
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
I think I'd be conserned with native DXL using these exact perms. May give it a whirl, but have decided to fix my immediate problem with a straight forward "itchy bad hack"; commenting out the offensive DXL code. -Louie Isaac: The Hurricane in the Gulf coming my way. |